v1.2.0#44
Merged
Merged
Conversation
The REST endpoint at /api/budget/accounts/ has always supported __gte /
__lte lookups on every numeric metric (the 26 fields in the backend's
RANGE_NUMERIC_FIELDS), but the SDK only forwarded identity / taxonomy
filters. Callers were forced to discover accounts by exact symbol
lookup; pipeline-style queries weren't expressible without dropping
to raw HTTP.
This change adds 78 explicit named parameters (each of the 26 range
fields × {exact, _gte, _lte}) so the discovery query "FY24 accounts
where contract share ≥ 60%, unobligated balance ≥ $200M, and next-year
growth ≥ 15%, sorted by largest headroom first" is a single SDK call.
Per the SDK's filter-surface non-negotiable, every new filter is an
explicit kwarg with a type hint — no **kwargs passthrough. Mapping body
is table-driven to keep the method readable.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
list_budget_accounts(). The REST endpoint at/api/budget/accounts/has always supported__gte/__ltelookups on every numeric metric (the 26 fields in the backend'sRANGE_NUMERIC_FIELDS); the SDK previously only forwarded identity / taxonomy filters, so callers were forced to discover accounts by exact symbol lookup._gte,_lte}). Each maps to the API'sfield__gte/field__lteform. Per the SDK's filter-surface non-negotiable inCLAUDE.md, every new filter is an explicit typed parameter — no**kwargspassthrough. Mapping body is table-driven so the method body doesn't balloon withif val is not Noneblocks.makegov.comblog post on the budget endpoint's discovery story (PR makegov/makegov.com#29) wants to show this query:Compatibility
Test plan
uv run ruff format+uv run ruff check tango/ tests/cleanuv run mypy tango/—Success: no issues found in 17 source filesuv run pytest tests/ -m \"not integration and not production\"— 302 passedfield__gte/field__lte; default call (no filters) sends only paging + shapetango.makegov.comreturned the expected 8 FY2024 accounts for the discovery query and matched the response from a hand-built HTTP probe